package com.shark.app.persistent.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by lenovo on 2016/8/17.
 */
@Entity
@Table(name = "t_wm_finance_sys_role", schema = "", catalog = "weimob_payment")
public class TWmFinanceSysRoleEntity {
    private int id;
    private String roleName;
    private String ename;
    private int parentRoleId;
    private int useAble;
    private Timestamp createTime;
    private Timestamp updateTime;
    private int updateUser;
    private int flag;
    private int version;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "role_name", nullable = false, insertable = true, updatable = true, length = 50)
    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Basic
    @Column(name = "ename", nullable = false, insertable = true, updatable = true, length = 50)
    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    @Basic
    @Column(name = "parent_role_id", nullable = false, insertable = true, updatable = true)
    public int getParentRoleId() {
        return parentRoleId;
    }

    public void setParentRoleId(int parentRoleId) {
        this.parentRoleId = parentRoleId;
    }

    @Basic
    @Column(name = "use_able", nullable = false, insertable = true, updatable = true)
    public int getUseAble() {
        return useAble;
    }

    public void setUseAble(int useAble) {
        this.useAble = useAble;
    }

    @Basic
    @Column(name = "create_time", nullable = false, insertable = true, updatable = true)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = false, insertable = true, updatable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "update_user", nullable = false, insertable = true, updatable = true)
    public int getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(int updateUser) {
        this.updateUser = updateUser;
    }

    @Basic
    @Column(name = "flag", nullable = false, insertable = true, updatable = true)
    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    @Basic
    @Column(name = "version", nullable = false, insertable = true, updatable = true)
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TWmFinanceSysRoleEntity that = (TWmFinanceSysRoleEntity) o;

        if (id != that.id) return false;
        if (parentRoleId != that.parentRoleId) return false;
        if (useAble != that.useAble) return false;
        if (updateUser != that.updateUser) return false;
        if (flag != that.flag) return false;
        if (version != that.version) return false;
        if (roleName != null ? !roleName.equals(that.roleName) : that.roleName != null) return false;
        if (ename != null ? !ename.equals(that.ename) : that.ename != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (roleName != null ? roleName.hashCode() : 0);
        result = 31 * result + (ename != null ? ename.hashCode() : 0);
        result = 31 * result + parentRoleId;
        result = 31 * result + useAble;
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + updateUser;
        result = 31 * result + flag;
        result = 31 * result + version;
        return result;
    }
}
